import time
import unittest

from Page.Page2 import Page2
from selenium import webdriver

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
class Test_Case(unittest.TestCase):
    def setUp(self):
        # 测试固件

        self.driver=webdriver.Edge()
        self.driver.maximize_window()

    def tearDown(self):
        time.sleep(10)
        self.driver.quit()

        # 测试用例
    def test_baidu_01(self):
        po= Page2(self.driver)
        po.test_jiegous()
        # po.open_url('https://www.jiuxian.com/')
        # po.login()
        # time.sleep(2)
        # day1=WebDriverWait(self.driver,20,0.5).until(EC.presence_of_element_located((By.XPATH,'//*[@id="loginform"]/div/div/div/div/div[1]/div[1]/a[1]'))).text
        # # day1=self.driver.find_element(By.XPATH,'//*[@id="loginform"]/div/div/div/div/div[1]/div[1]/a[1]').text
        # self.assertEqual("账号登录",str(day1))
        # # time.sleep(2)
        # print(day1)
        # po.username()
        # po.password()
        # time.sleep(10)
        # po.dianlogin()
        # po.dianquery()
        # time.sleep(2)
        # day2= self.driver.find_element(By.XPATH, '/html/body/div[2]/div/div[1]/div/p/span').text
        # self.assertEqual("jxw334934844", day2)
        # print(day2)
        # time.sleep(2)

if __name__ == '__main__':
    unittest.main()